﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using HotelManagement.DTO;

namespace HotelManagement.DAO
{
    class CustomerTypeDAO:DataProvider
    {
        public CustomerTypeDAO()
            :base()
        {

        }

        public bool Insert(CustomerTypeDTO custType)
        {
            string strInsert = "insert into CUSTOMERTYPE(TypeName) values (";
            strInsert += "'" + custType.TypeName + "')";
            return base._ExecuteQuery(strInsert);
        }

        public bool Update(CustomerTypeDTO custType)
        {
            string strUpdate = "update CUSTOMERTYPE set TypeName='" + custType.TypeName + "' where CusTypeID=" + custType.CusTypeID;

            return base._ExecuteQuery(strUpdate);
        }

        public bool Delete(CustomerTypeDTO custType)
        {
            string strDelete = "delete from CUSTOMERTYPE where CusTypeID=" + custType.CusTypeID;

            return base._ExecuteQuery(strDelete);
        }

        public DataTable Select()
        {
            string strSelect = "select * from customertype";
            //DataSet set = new DataSet();
            return base._Select(strSelect);
        }
    }
}
